<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<style>
    .error{
        color: red;
    }
</style>
<%@include file="common/header.jsp" %>
<div class>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <div>
                        <span style="color: black">修改APP版本信息<span class="fa fa-user" style="color: black"></span></span>
                        ${devUser.devName}
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="x_title">
                    <div>
                        历史版本列表
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <table class="table table-striped table-bordered" style="border: 1px">
                        <tr>
                            <th>软件名称</th>
                            <th>版本号</th>
                            <th>版本大小(单位:M)</th>
                            <th>发布状态</th>
                            <th>APK文件下载</th>
                            <th>最新更新时间</th>
                        </tr>
                        <c:forEach var="a" items="${versionList}">
                            <tr id="">
                                <td>${a.softwareName}</td>
                                <td>${a.versionNo}</td>
                                <td>${a.versionSize}</td>
                                <td>
                                    <c:if test="${a.publishStatus == 1}">不发布</c:if>
                                    <c:if test="${a.publishStatus == 2}">已发布</c:if>
                                    <c:if test="${a.publishStatus == 3}">预发布</c:if>
                                </td>
                                <td>${a.apkLocPath}</td>
                                <td>
                                    <fmt:formatDate value="${a.modifyDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </td>
                            </tr>
                        </c:forEach>
                    </table>
                </div>
                <div class="x_title">
                    <div>
                        修改版本信息
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form class="form-horizontal form-label-left" id="modifyAppVersion" method="post" action="${pageContext.request.contextPath }/modifyAppVersion"
                          enctype="multipart/form-data">
                        <p style="color: red">${mess}</p>
                        <input type="hidden" name=appId value="${appId}">
                        <input type="hidden" name="id" value="${appVersion.id}">
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionNo">版本号 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="versionNo" class="form-control col-md-7 col-xs-12"
                                       data-validate-length-range="6" data-validate-words="2" name="versionNo"
                                       placeholder="请输入版本号" required="required" type="text" value="${appVersion.versionNo}" readonly="readonly">
                            </div>
                            <span id="tips_versionNo" class="tips"></span>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionSize">版本大小 <span
                                    class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="versionSize" class="form-control col-md-7 col-xs-12"
                                       data-validate-length-range="6" data-validate-words="2" name="versionSize"
                                       placeholder="请输入版本大小，单位为Mb" required="required" type="number" value="${appVersion.versionSize}">
                            </div>
                            <span id="tips_versionSize" class="tips"></span>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">发布状态 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <c:if test="${appVersion.status == 1}">待审核</c:if>
                                <c:if test="${appVersion.status == 3}">审核未通过</c:if>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="textarea">版本简介<span
                                    class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <textarea id="textarea" required="required" name="textarea"
                                          class="form-control col-md-7 col-xs-12"
                                          placeholder="请输入本版本的相关信息,本信息作为该版本的详细信息进行版本介绍。">${appVersion.versionInfo}</textarea>
                            </div>
                            <span id="tips_textarea" class="tips"></span>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="apkFile">apk文件 <span class="required">*</span>
                            </label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <input id="apkFile" class="form-control col-md-7 col-xs-12" data-validate-length-range="6"
                                       data-validate-words="2" name="apkFile" required="required" type="file" onchange="verificationPicFile(this)">
                            </div>
                            <span id="tips_apkFlie" class="tips"></span>
                        </div>
                        <div class="ln_solid"></div>
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-3">
                                <button id="send" type="submit" class="btn btn-success">保存</button>
                                <a href="${pageContext.request.contextPath }/devShow">
                                    <button type="button" class="btn btn-primary">返回</button>
                                </a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<%@include file="common/footer.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/modifyAppVersion.js"></script>
